package com.agileboot.domain.banner.query;

import cn.hutool.core.util.StrUtil;
import com.agileboot.common.core.page.AbstractPageQuery;
import com.agileboot.domain.banner.db.HomeBanner;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class HomeBannerQuery extends AbstractPageQuery<HomeBanner> {

    private String name;
    /**
     * 状态
     */
    @ApiModelProperty("状态,0启用 1禁用")
    private Integer status;

    @Override
    public QueryWrapper<HomeBanner> addQueryCondition() {
        QueryWrapper<HomeBanner> queryWrapper = new QueryWrapper<>();
        queryWrapper.like(StrUtil.isNotEmpty(name),"name",name);
        queryWrapper.eq(StrUtil.isNotEmpty(String.valueOf(status)),"status",status);
        queryWrapper.eq("deleted", 0);
        return queryWrapper;
    }
}
